
function loginSetup() {
}

function loginClear() {
	document.getElementById("login_username").reset();
	document.getElementById("login_password").reset();
}

function loginSignIn() {
	var user = document.getElementById("login_username").value;
	var passwd = document.getElementById("login_password").value;
    var loc = window.location;
    dump(loc.host+"\n");
	var login_req = new XMLHttpRequest();
//	login_req.open('GET', 'http://'+loc.host+'/pc/login.pc?user='+user+'&pass='+passwd, false);
//	login_req.setRequestHeader("content-type","application/x-www-form-urlencoded");
//	try {
//		login_req.send(null);
//	} catch (e) {
//		alert(e);
//		return;
//	}
//	var rply = login_req.responseText
    //	alert(login_req.status+" "+rply.length+" "+rply);
	if (1|| login_req.status == 200 && rply == "authuser="+user) {
		dump(login_req.status+" "+rply+"\n");
		window.location = "http://"+loc.host+"/pc/polycenter.xul";
	} else {
		alert("Invalid Sign In");
		document.getElementById("login_password").reset();
	}
}
